Skip to content

[codex] Add IBIT zscore switch controls#69

Merged
Pigbibi merged 1 commit into
mainfrom
codex/ibit-zscore-switch-settings
Jun 19, 2026
Merged

[codex] Add IBIT zscore switch controls#69
Pigbibi merged 1 commit into
mainfrom
codex/ibit-zscore-switch-settings

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add IBIT Z-Score exit controls to the manual runtime switch builder and strategy switch console.
  • Auto-mount the ibit_zscore_exit plugin for ibit_smart_dca, expose paper/live/disabled modes, and keep direct runtime variable writes guarded behind typed control fields.
  • Sync the internal dependency matrix to the merged strategy/runtime pins.

Test Plan

  • git diff-tree --check --no-commit-id --root -r HEAD
  • python3 scripts/runtime_settings.py validate
  • python3 -m unittest discover -s tests -v
  • python3 scripts/check_internal_dependency_matrix.py --projects-root .. --json
  • python3 scripts/sync_strategy_switch_page_asset.py && git diff --exit-code -- web/strategy-switch-console/page_asset.js web/strategy-switch-console/strategy_profiles_asset.js
  • jq empty web/strategy-switch-console/strategy-profiles.example.json
  • node tests/strategy_switch_worker_validation.mjs
  • sed -n '/<script>/,/<\/script>/p' web/strategy-switch-console/index.html | sed '1d;$d' | node --check --input-type=commonjs
  • node --check --input-type=module < web/strategy-switch-console/page_asset.js
  • node --check --input-type=module < web/strategy-switch-console/strategy_profiles_asset.js
  • node --check --input-type=module < web/strategy-switch-console/worker.js

@Pigbibi Pigbibi merged commit 10945b2 into main Jun 19, 2026
2 checks passed
@Pigbibi Pigbibi deleted the codex/ibit-zscore-switch-settings branch June 19, 2026 21:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f16031d364

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +548 to +553
if profile == IBIT_ZSCORE_EXIT_STRATEGY_PROFILE and _has_enabled_plugin_mount(
plugin_mounts,
strategy_profile=profile,
plugin=IBIT_ZSCORE_EXIT_PLUGIN,
):
return dict(US_DAILY_SCHEDULER)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep disabled IBIT mode on the DCA schedule

When a user selects ibit_zscore_exit_mode=disabled while leaving plugin_mode=auto (the console exposes this as “Disabled (buy only)”), _plugin_mounts still auto-mounts ibit_zscore_exit, so this branch returns US_DAILY_SCHEDULER even though the generated variables set IBIT_ZSCORE_EXIT_ENABLED=false. That changes a disabled/buy-only ibit_smart_dca target from the existing monthly DCA window to the daily main/probe cron, so ordinary DCA runs can be attempted every trading day. Gate the daily schedule on the exit mode being paper/live, or disable the mount when the mode is disabled.

Useful? React with 👍 / 👎.

Comment on lines +899 to +900
} else if ("ibit_zscore_exit_mode" in nextOption) {
delete nextOption.ibit_zscore_exit_mode;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve saved IBIT mode when sync payload omits it

For IBIT accounts, this deletes ibit_zscore_exit_mode whenever the sync input lacks that field. The existing workflow sync payload in .github/workflows/manual-strategy-switch.yml only forwards DCA fields from extra_variables (lines 398-402), so a manual workflow run that posts to /api/internal/sync-account-default will clear a previously saved paper/disabled IBIT mode even though the builder may have just applied IBIT runtime controls. Treat a missing mode as “leave unchanged” or include the mode in the workflow sync payload.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant